home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbwinfnt.zip / EX_LDFNT.BAS < prev    next >
BASIC Source File  |  1994-03-01  |  1KB  |  36 lines

  1.       REM:  EX_LDFNT.BAS, Unregistered Version 1.0
  2.       REM:  Example of loading a font from Windows' font (FNT) file.
  3.  
  4.       DECLARE SUB FastString (Text$, FClr%, X%, Y%, FontArray%())
  5.       DECLARE SUB LoadFontFile (FlName$, FontArray%(), RetCode%, RetMsg$)
  6.      
  7.       '...setup a VGA screen mode...
  8.       SCREEN 12
  9.  
  10.       '...prompt for a file name and file number...
  11.       INPUT "Enter Windows' font file (FNT) name (try SAMPLE.FNT): ", FlName$
  12.      
  13.       '...dim array for font data (use REDIM so its DYNAMIC)...
  14.       REDIM FontArray%(1)
  15.      
  16.       PRINT : PRINT "Loading font from "; FlName$; "..."
  17.      
  18.       '...load the specified font from the file...
  19.       CALL LoadFontFile(FlName$, FontArray%(), RetCode%, RetMsg$)
  20.      
  21.       IF (RetCode% <> 0) THEN
  22.        
  23.         PRINT
  24.         PRINT "***** ERROR: RetCode% = "; RetCode%
  25.         PRINT "***** "; RetMsg$
  26.        
  27.       ELSE
  28.      
  29.         '...display a sample of the font...
  30.         CALL FastString("Sample of Font ", 2, 20, 80, FontArray%())
  31.        
  32.       END IF
  33.      
  34.       END
  35.  
  36.